package com.business.wechat.bean;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.annotations.SerializedName;

import lombok.Getter;
import lombok.Setter;
import net.sf.rose.jdbc.bean.annotation.Column;
import net.sf.rose.jdbc.bean.annotation.Table;
import net.sf.rose.jdbc.bean.annotation.Type;

@Table(name = "WX_MENU", description = "微信菜单信息表")
public class WeixinMenuBean {

	@Column(pk = true, type = Type.定长文本, description = "编号", canNull = false, size = 32, policy = "UUID")
	private String menuID;

	@Setter
	@Getter
	@Column(type = Type.定长文本, description = "微信编号", canNull = false, size = 32)
	private String weixinID;

	/**
	 * <pre>
	 * 菜单的响应动作类型.
	 * view表示网页类型，
	 * click表示点击类型，
	 * miniprogram表示小程序类型
	 * </pre>
	 */
	@Column(type = Type.变长文本, description = "动作类型", size = 30)
	private String menuType;

	/**
	 * 菜单标题，不超过16个字节，子菜单不超过60个字节.
	 */
	@Column(type = Type.变长文本, description = "菜单标题", size = 60)
	private String label;

	/**
	 * <pre>
	 * 菜单KEY值，用于消息接口推送，不超过128字节.
	 * click等点击类型必须
	 * </pre>
	 */
	@Column(type = Type.变长文本, description = "菜单KEY值", size = 128)
	private String menuKey;

	/**
	 * <pre>
	 * 网页链接.
	 * 用户点击菜单可打开链接，不超过1024字节。type为miniprogram时，不支持小程序的老版本客户端将打开本url。
	 * view、miniprogram类型必须
	 * </pre>
	 */
	@Column(type = Type.变长文本, description = "网页链接", size = 1024)
	private String menuUrl;

	@Column(type = Type.数字整型, description = "排序")
	private int sequence = 0;

	/**
	 * <pre>
	 * 调用新增永久素材接口返回的合法media_id.media_id类型和view_limited类型必须
	 * </pre>
	 */
	@Column(type = Type.变长文本, description = "素材编号", size = 250)
	@SerializedName("media_id")
	private String mediaId;

	/**
	 * <pre>
	 * 小程序的appid.miniprogram类型必须
	 * </pre>
	 */
	@Column(type = Type.变长文本, description = "APPID", size = 50)
	@SerializedName("appid")
	private String appId;

	/**
	 * <pre>
	 * 小程序的页面路径.miniprogram类型必须
	 * </pre>
	 */
	@Column(type = Type.变长文本, description = "页面路径", size = 250)
	@SerializedName("pagepath")
	private String pagePath;

	@Column(type = Type.变长文本, description = "父编号", size = 32)
	private String parentID = null;

	private List<WeixinMenuBean> children = new ArrayList<>();

	public String getMenuID() {
		return menuID;
	}

	public void setMenuID(String menuID) {
		this.menuID = menuID;
	}

	public String getMenuType() {
		return menuType;
	}

	public void setMenuType(String menuType) {
		this.menuType = menuType;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getMenuKey() {
		return menuKey;
	}

	public void setMenuKey(String menuKey) {
		this.menuKey = menuKey;
	}

	public String getMenuUrl() {
		return menuUrl;
	}

	public void setMenuUrl(String menuUrl) {
		this.menuUrl = menuUrl;
	}

	public int getSequence() {
		return sequence;
	}

	public void setSequence(int sequence) {
		this.sequence = sequence;
	}

	public String getMediaId() {
		return mediaId;
	}

	public void setMediaId(String mediaId) {
		this.mediaId = mediaId;
	}

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getPagePath() {
		return pagePath;
	}

	public void setPagePath(String pagePath) {
		this.pagePath = pagePath;
	}

	public String getParentID() {
		return parentID;
	}

	public void setParentID(String parentID) {
		this.parentID = parentID;
	}

	public List<WeixinMenuBean> getChildren() {
		return children;
	}

	public void setChildren(List<WeixinMenuBean> children) {
		this.children = children;
	}

}
